<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/11
 * Time: 12:09
 */

require_once APP_PATH."/app/Controller.php";
require_once APP_PATH."/app/database/DB.php";

class IndexController extends Controller {
    /**
     * 首页
     */
    public function index(){
        $db = new DB();
        $data = $db->query('SELECT tid,subject FROM pw_threads LIMIT 10');
        print_r($data);
        $db = new DB('xzapp');
        $data = $db->query("SELECT content FROM app_posts LIMIT 10");
        foreach ($data as $val){
            echo iconv('utf-8','gbk//IGNORE',$val['content']).'<br>';
        }
        exit;
        $this->views('index',[]);
    }


}